program example
use polymorphic_complextaylor
implicit none 
integer no,nv,i
type(complextaylor) f,g
complex(dp) c,cc,ccc
integer, allocatable :: j(:) ,k(:)

no=4; nv= 2;    ! no: the order of the polynomial    nv: the number of variables   
call init(no,nv)  ! initializes taylor series without maps

call alloc(f,g)      ! must be constructed after init

allocate(j(nv),k(nv)) 


j=0
j(1)=1;j(2)=2;

k=0
k(1)=3;k(2)=1;


c=cmplx(5.d0,-1.4d0,kind=dp)
cc=cmplx(6.d0,1.6d0,kind=dp)
  

f=(c.mono.j) + (cc.mono.k)         !  <-----------------  changed
   ! Creates (5.d0 x_1x_2^2 - 1.4d0 i* x_1x_2^2) + (6.d0 x_1^3x_2 + 1.6d0 i*  x_1^3x_2)
call print(f,6)    


f=(c.mono.'02') + (cc.mono.'13')      !  <-----------------  changed
   ! Creates (5.d0 x_2^2 - 1.4d0 i* x_2^2) + (6.d0 x_1x_2^3 + 1.6d0 i*  x_1x_2^3)
call print(f,6)     



deallocate(j,k)
call kill(f,g)      ! must be destroyed
end program example
